package demo1;

import java.util.Arrays;
import java.util.Scanner;


public class Day0303 {
    public static void main(String[] args) {
        long a = System.currentTimeMillis();
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int n = in.nextInt();
        int k = in.nextInt();
        int[] arr = new int[n];
        int[] arr0 = new int[n];
        int len = 0;
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
            if(arr[i] % 2 == 0) {
                arr0[len] = arr[i];
                len++;
            }
        }
        arr0 = Arrays.copyOf(arr0,len);
        int sum = sum(arr) - sum(arr0);
        Arrays.sort(arr0);
        int count = len;
        while(k>0) {
            while(arr0[count-1] >= arr0[count-2] && arr0[count-1] % 2 == 0 && k>0) {
                arr0[count-1] /= 2;
                k--;
            }
            if(arr0[count-1] % 2 != 0) {
                sum += arr0[count-1];
                count--;
                arr0 = Arrays.copyOf(arr0,count);
            }
            Arrays.sort(arr0);
        }
        sum += sum(arr0);
        System.out.println(sum);
        long b = System.currentTimeMillis();
        System.out.println(b-a);
    }

    private static int sum(int[] arr) {
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        return sum;
    }
}
